<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="body">
            <p:panel header="#{bundle.ListAccDocTitle}" />

            <h:form styleClass="jsfcrud_list_form">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListAccDocEmpty}" rendered="#{accDocController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{accDocController.items.rowCount > 0}">
                    <h:outputText value="#{accDocController.pagination.pageFirstItem + 1}..#{accDocController.pagination.pageLastItem + 1}/#{accDocController.pagination.itemsCount}"/>&nbsp;
                    <h:commandLink action="#{accDocController.previous}" value="#{bundle.Previous} #{accDocController.pagination.pageSize}" rendered="#{accDocController.pagination.hasPreviousPage}"/>&nbsp;
                    <h:commandLink action="#{accDocController.next}" value="#{bundle.Next} #{accDocController.pagination.pageSize}" rendered="#{accDocController.pagination.hasNextPage}"/>&nbsp;
                    <p:dataTable value="#{accDocController.items}" var="item" cellSeparator="1"  >

                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListAccDocTitle_idAccDoc}"/>
                            </f:facet>
                            <h:outputText value="#{item.idAccDoc}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListAccDocTitle_nombre}"/>
                            </f:facet>
                            <h:outputText value="#{item.nombre}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListAccDocTitle_descripcion}"/>
                            </f:facet>
                            <h:outputText value="#{item.descripcion}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListAccDocTitle_estado}"/>
                            </f:facet>
                            <h:outputText value="#{item.estado}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink action="#{accDocController.prepareView}" value="#{bundle.ListAccDocViewLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{accDocController.prepareEdit}" value="#{bundle.ListAccDocEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{accDocController.destroy}" value="#{bundle.ListAccDocDestroyLink}"/>
                        </p:column>
                    </p:dataTable>



                    <!--h:dataTable value="#{accDocController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px; margin: 0 auto" -->

                    <!--/h:dataTable-->
                </h:panelGroup>
                <br />
                <h:commandLink action="#{accDocController.prepareCreate}" value="#{bundle.ListAccDocCreateLink}"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.ListAccDocIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
